package edu.eas.admin.service.impl;

import edu.eas.admin.mapper.DictDataMapper;
import edu.eas.admin.mapper.DictTypeMapper;
import edu.eas.admin.service.DictTypeService;
import edu.eas.common.pojo.DictData;
import edu.eas.common.pojo.DictType;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author cql
 */
@Service
public class DictTypeServiceImpl implements DictTypeService {

    @Autowired
    private DictDataMapper dictDataMapper;

    @Autowired
    private DictTypeMapper dictTypeMapper;

    @Override
    public List<DictData> selectDictDataByType(String dictType) {
        List<DictData> dictDatas = dictDataMapper.selectDictDataByType(dictType);
        // TODO 加上缓存
        return dictDatas;
    }

    @Override
    public List<DictType> selectDictTypeAll() {
        return dictTypeMapper.selectDictTypeAll();
    }
}
